<!DOCTYPE html><html lang="zh-Hans"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta name="description" content="项目引入灵珑优化"><meta name="keywords" content="vue"><meta name="author" content="晟松"><meta name="copyright" content="晟松"><title>项目引入灵珑优化 | 晟松</title><link rel="shortcut icon" href="/logo.png"><link rel="stylesheet" href="/css/index.css?version=1.9.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css?version=1.9.0"><meta name="format-detection" content="telephone=no"><meta http-equiv="x-dns-prefetch-control" content="on"><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="dns-prefetch" href="https://hm.baidu.com"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?c34d81d53341febe06a155941e2df16d";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();</script><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容:${query}"}},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  hexoVersion: '5.4.0'
} </script><meta name="generator" content="Hexo 5.4.0"></head><body><i class="fa fa-arrow-right" id="toggle-sidebar" aria-hidden="true"></i><div id="sidebar" data-display="true"><div class="toggle-sidebar-info text-center"><span data-toggle="切换文章详情">切换站点概览</span><hr></div><div class="sidebar-toc"><div class="sidebar-toc__title">目录</div><div class="sidebar-toc__progress"><span class="progress-notice">你已经读了</span><span class="progress-num">0</span><span class="progress-percentage">%</span><div class="sidebar-toc__progress-bar"></div></div><div class="sidebar-toc__content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A1%B9%E7%9B%AE%E5%BC%95%E5%85%A5%E7%81%B5%E7%8F%91%E4%BC%98%E5%8C%96"><span class="toc-number">1.</span> <span class="toc-text">项目引入灵珑优化</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%9B%AE%E5%89%8D%E7%9A%84%E6%80%9D%E8%B7%AF%E5%A4%A7%E6%A6%82%E5%8F%AF%E5%88%86%E4%B8%BA%E4%B8%A4%E7%A7%8D"><span class="toc-number">1.1.</span> <span class="toc-text">目前的思路大概可分为两种</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%80%E4%B8%BA%E9%83%A8%E5%88%86%E7%AE%80%E5%8C%96"><span class="toc-number">1.1.1.</span> <span class="toc-text">一为部分简化</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BA%8C%E4%B8%BA%E8%B7%AF%E7%94%B1%E6%B7%BB%E5%8A%A0"><span class="toc-number">1.1.2.</span> <span class="toc-text">二为路由添加</span></a></li></ol></li></ol></li></ol></div></div><div class="author-info hide"><div class="author-info__avatar text-center"><img src="/img/avatar.png"></div><div class="author-info__name text-center">晟松</div><div class="author-info__description text-center">晟松的博客</div><div class="follow-button"><a target="_blank" rel="noopener" href="https://gitee.com/cheng_song">Gitee</a></div><hr><div class="author-info-articles"><a class="author-info-articles__archives article-meta" href="/archives"><span class="pull-left">文章</span><span class="pull-right">52</span></a><a class="author-info-articles__tags article-meta" href="/tags"><span class="pull-left">标签</span><span class="pull-right">45</span></a></div></div></div><div id="content-outer"><div id="top-container" style="background-image: url(/img/blog-bg.jpg)"><div id="page-header"><span class="pull-left"> <a id="site-name" href="/">晟松</a></span><i class="fa fa-bars toggle-menu pull-right" aria-hidden="true"></i><span class="pull-right menus">   <a class="site-page" href="/">Home</a><a class="site-page" href="/archives">Archives</a><a class="site-page" href="/tags">Tags</a><a class="site-page" href="/categories">Categories</a></span><span class="pull-right"><a class="site-page social-icon search"><i class="fa fa-search"></i><span> 搜索</span></a></span></div><div id="post-info"><div id="post-title">项目引入灵珑优化</div><div id="post-meta"><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2022-07-16</time><div class="post-meta-wordcount"><span>字数总计: </span><span class="word-count">3.1k</span><span class="post-meta__separator">|</span><span>阅读时长: 14 分钟</span></div></div></div></div><div class="layout" id="content-inner"><article id="post"><div class="article-container" id="post-content"><h2 id="项目引入灵珑优化"><a href="#项目引入灵珑优化" class="headerlink" title="项目引入灵珑优化"></a>项目引入灵珑优化</h2><p>在一些场景中，可能会出现本项目全部由灵珑页面所构成，也可能出现其中大部分的界面可由灵珑构成，在传统的灵珑页面使用方式中，其在需要多次引入灵珑时，先创建对应的路由文件，再多次创建相似度极高的页面目录，其中大部分都只会是pageId不同，小部分可能会出现展示的renderView不同，典型即为<strong>urban-manage-vue\src\pages\propOpinion</strong>项目，如果对这部分进行优化，那么在开发上还是有一点作用的。</p>
<p><img src="https://gitee.com/cheng_song/picgo-img/raw/master/img/2022-07-16-15-22-16-image.png" alt="image-20220723132042050"></p>
<h3 id="目前的思路大概可分为两种"><a href="#目前的思路大概可分为两种" class="headerlink" title="目前的思路大概可分为两种"></a>目前的思路大概可分为两种</h3><h4 id="一为部分简化"><a href="#一为部分简化" class="headerlink" title="一为部分简化"></a>一为部分简化</h4><p>主要为修改route/index.ts文件，同步修改其中页面的<strong>component</strong>属性，属性修改为同一个组件，并建立配置文件，配置页面路由与需要展示的pageId或其他参数。相对应原始引入的方式的话，可减少页面目录和里面每一次基本相同的html、css、ts的创建，最终汇总到一个文件，并在此文件中自动根据配置和路由匹配对应的pageId进行展示</p>
<p>其中配置文件类似于如此</p>
<figure class="highlight ts"><table><tr><td class="code"><pre><span class="line"><span class="keyword">interface</span> routePageId &#123;</span><br><span class="line">    <span class="attr">route</span>: &#123; <span class="attr">name</span>: <span class="built_in">string</span>; path: <span class="built_in">string</span> &#125;;</span><br><span class="line">    dataKey: &#123;</span><br><span class="line">        <span class="attr">pageId</span>: <span class="built_in">string</span>;</span><br><span class="line">        documentNo?: <span class="built_in">string</span>;</span><br><span class="line">        version?: <span class="built_in">string</span>;</span><br><span class="line">    &#125;;</span><br><span class="line">    [prop: <span class="built_in">string</span>]: <span class="built_in">any</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">const</span> routeAndLinglongId: routePageId[] = [</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="attr">route</span>: &#123;</span><br><span class="line">            <span class="attr">name</span>: <span class="string">&quot;solved&quot;</span>,</span><br><span class="line">            <span class="attr">path</span>: <span class="string">&quot;/company/solved&quot;</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="attr">dataKey</span>: &#123;</span><br><span class="line">            <span class="attr">pageId</span>: <span class="string">&quot;97b55d18-2497-47c0-8a33-9a8d286dd42c&quot;</span>,</span><br><span class="line">            <span class="attr">version</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="attr">documentNo</span>: <span class="string">&quot;&quot;</span></span><br><span class="line">        &#125;</span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="attr">route</span>: &#123;</span><br><span class="line">            <span class="attr">name</span>: <span class="string">&quot;pending&quot;</span>,</span><br><span class="line">            <span class="attr">path</span>: <span class="string">&quot;/company/pending&quot;</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="attr">dataKey</span>: &#123;</span><br><span class="line">            <span class="attr">pageId</span>: <span class="string">&quot;720b6a5b-999a-4c64-be0c-b5dd2ef1612c&quot;</span>,</span><br><span class="line">            <span class="attr">version</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="attr">documentNo</span>: <span class="string">&quot;&quot;</span></span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">];</span><br></pre></td></tr></table></figure>

<p>而对应路由的修改即为将页面的组件全部赋值到某一页面中，注意下面的已处理与待处理对应的component为同一个</p>
<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line">&#123;</span><br><span class="line">            <span class="attr">path</span>: <span class="string">&quot;/company&quot;</span>,</span><br><span class="line">            <span class="attr">name</span>: <span class="string">&quot;company&quot;</span>,</span><br><span class="line">            <span class="attr">meta</span>: &#123;</span><br><span class="line">                <span class="attr">title</span>: <span class="string">&quot;物业企业&quot;</span>,</span><br><span class="line">                <span class="attr">isMenuGroup</span>: <span class="literal">true</span></span><br><span class="line">            &#125;,</span><br><span class="line">            <span class="attr">redirect</span>: <span class="string">&quot;/company/solved&quot;</span>,</span><br><span class="line">            <span class="attr">component</span>: <span class="function">() =&gt;</span> <span class="keyword">import</span>(<span class="string">&quot;@/components/layout/blank/index&quot;</span>),</span><br><span class="line">            <span class="attr">children</span>: [</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="attr">name</span>: <span class="string">&quot;solved&quot;</span>,</span><br><span class="line">                    <span class="attr">path</span>: <span class="string">&quot;solved&quot;</span>,</span><br><span class="line">                    <span class="attr">meta</span>: &#123;</span><br><span class="line">                        <span class="attr">icon</span>: <span class="string">&quot;icon-folder&quot;</span>,</span><br><span class="line">                        <span class="attr">title</span>: <span class="string">&quot;已处理&quot;</span>,</span><br><span class="line">                        <span class="attr">schemaId</span>: <span class="string">&quot;propOpinion:solvedTasks&quot;</span></span><br><span class="line">                    &#125;,</span><br><span class="line">                    <span class="attr">component</span>: <span class="function">() =&gt;</span> <span class="keyword">import</span>(<span class="string">&quot;@/pages/propOpinion/views/linglongTest&quot;</span>)</span><br><span class="line">                &#125;,</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="attr">name</span>: <span class="string">&quot;pending&quot;</span>,</span><br><span class="line">                    <span class="attr">path</span>: <span class="string">&quot;pending&quot;</span>,</span><br><span class="line">                    <span class="attr">meta</span>: &#123;</span><br><span class="line">                        <span class="attr">icon</span>: <span class="string">&quot;icon-folder&quot;</span>,</span><br><span class="line">                        <span class="attr">title</span>: <span class="string">&quot;待处理&quot;</span>,</span><br><span class="line">                        <span class="attr">schemaId</span>: <span class="string">&quot;propOpinion:pendingTasks&quot;</span></span><br><span class="line">                    &#125;,</span><br><span class="line">                    <span class="attr">component</span>: <span class="function">() =&gt;</span> <span class="keyword">import</span>(<span class="string">&quot;@/pages/propOpinion/views/linglongTest&quot;</span>)</span><br><span class="line">                &#125;</span><br><span class="line">            ]</span><br><span class="line">        &#125;,</span><br></pre></td></tr></table></figure>

<p>而最关键的linglongTest中，即为自动引入配置，并利用核心api <strong>beforeRouteEnter</strong>进行路由修改时，对应pageId修改，展示对应的灵珑页面</p>
<p>官方说明：</p>
<figure class="highlight javascript"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="title">beforeRouteEnter</span>(<span class="params">to, <span class="keyword">from</span>, next</span>)</span> &#123;</span><br><span class="line">    <span class="comment">// 在渲染该组件的对应路由被 confirm 前调用</span></span><br><span class="line">    <span class="comment">// 不！能！获取组件实例 `this`</span></span><br><span class="line">    <span class="comment">// 因为当守卫执行前，组件实例还没被创建</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="function"><span class="title">beforeRouteUpdate</span>(<span class="params">to, <span class="keyword">from</span>, next</span>)</span> &#123;</span><br><span class="line">    <span class="comment">// 在当前路由改变，但是该组件被复用时调用</span></span><br><span class="line">    <span class="comment">// 举例来说，对于一个带有动态参数的路径 /foo/:id，在 /foo/1 和 /foo/2 之间跳转的时候，</span></span><br><span class="line">    <span class="comment">// 由于会渲染同样的 Foo 组件，因此组件实例会被复用。而这个钩子就会在这个情况下被调用。</span></span><br><span class="line">    <span class="comment">// 可以访问组件实例 `this`</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="function"><span class="title">beforeRouteLeave</span>(<span class="params">to, <span class="keyword">from</span>, next</span>)</span> &#123;</span><br><span class="line">    <span class="comment">// 导航离开该组件的对应路由时调用</span></span><br><span class="line">    <span class="comment">// 可以访问组件实例 `this`</span></span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>

<p><code>注</code>：这里为什么使用beforeRouteEnte而不使用beforeRouteUpdate的原因为：beforeRouteUpdate的调用需要在路由的name和path不变的情况下，路由的query或params被修改了才会被调用，所以无法实现更新。</p>
<p>虽然使用了同一个页面组件，在路由切换时，这个页面也一直存在，不会被销毁，里面的数据也存在，但是无法beforeRouteUpdate进行监听修改，是一不进行使用</p>
<p>activated生命周期配合keep-alive进行使用时，需要组件被切换，这里组件没有被修改，所以也不行</p>
<p><img src="https://gitee.com/cheng_song/picgo-img/raw/master/img/2022-07-16-15-06-48-image.png" alt="image-20220723132042050"></p>
<p>最后关键的beforeRouteEnter的具体实现如下：</p>
<figure class="highlight ts"><table><tr><td class="code"><pre><span class="line"><span class="keyword">public</span> pageConfig: routePageId[] = routeAndLinglongId;</span><br><span class="line">   <span class="comment">// 默认设置</span></span><br><span class="line">   <span class="keyword">public</span> dataKey1: DataKey = &#123; <span class="attr">pageId</span>: <span class="string">&quot;&quot;</span> &#125;;</span><br><span class="line">   <span class="keyword">public</span> <span class="function"><span class="title">beforeRouteEnter</span>(<span class="params">to: <span class="built_in">any</span>, <span class="keyword">from</span>: <span class="built_in">any</span>, next: <span class="built_in">any</span></span>)</span> &#123;</span><br><span class="line">       next(<span class="function">(<span class="params">vm: <span class="built_in">any</span></span>) =&gt;</span> &#123;</span><br><span class="line">           <span class="keyword">let</span> &#123; name &#125; = to;</span><br><span class="line">           <span class="comment">// 寻找route name对应的dataKey</span></span><br><span class="line">           <span class="keyword">let</span> config = vm.pageConfig.find(<span class="function">(<span class="params">item: routePageId</span>) =&gt;</span> item.route.name === name);</span><br><span class="line">           <span class="built_in">console</span>.log(<span class="string">&quot;config: &quot;</span>, config?.route?.name, config?.dataKey?.pageId);</span><br><span class="line">           <span class="keyword">if</span> (config?.dataKey?.pageId) &#123;</span><br><span class="line">               vm.dataKey1 = config.dataKey;</span><br><span class="line">           &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">               <span class="built_in">console</span>.error(<span class="string">&quot;不存在此灵珑页面&quot;</span>);</span><br><span class="line">           &#125;</span><br><span class="line">       &#125;);</span><br><span class="line">   &#125;</span><br></pre></td></tr></table></figure>

<p>最后在一些需要扩展的页面时，因为这里route/index.ts是自行定义的，所以可以直接的进行修改，进行扩展，不影响其他页面。</p>
<h4 id="二为路由添加"><a href="#二为路由添加" class="headerlink" title="二为路由添加"></a>二为路由添加</h4><p>这里的路由添加指的是 vue-route 提供的api <strong>router.addRoute</strong>，这种场景主要是存在最开始所说的propOpinion项目这种，基本不存在自定义页面时的更简化的使用，但这种使用似乎有极大的隐患，因为项目基础在utils/PermissionUtil.ts或其他的workbench.ts中存在对于路由的操作，这一部分操作有极大的可能会受到初始未定义具体route，反而动态添加路由的影响，造成未知的后果，且这一部分过于复杂，故给出一简单未验证示例供以参考。</p>
<p>这里主要通过PermissionUtil.getPermissions返回的用户被允许的页面route.meta.schemaId和请求后端返回的humanNavBarItems数据进行页面构造</p>
<p>至于在什么地方进行addroute路由添加，这里根据请求的地址给出两个地方</p>
<ul>
<li><p>LoginUtil/loadUserInfo.ts中的getHumanNavData()后面</p>
</li>
<li><p>另一个则为misLogin/index.ts-login()方法中进行添加</p>
</li>
</ul>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">permissions:[</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:superviseInspect&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:objectiveManagement&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:departmentYearlyTask&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:personalYearlyTask&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:quarterSelfEvaluation&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:leaderAssigned&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:lawSuperviseAlarm&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:dailyRecord&quot;</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;value&quot;</span>: <span class="string">&quot;superviseInspect:transportManage&quot;</span></span><br><span class="line">    &#125;</span><br><span class="line">]</span><br><span class="line"></span><br><span class="line"><span class="attr">humanNavBarItems</span>:[</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span>,</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112260</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112281</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;superviseInspect&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;督查督办&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;督查督办&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112260</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="literal">null</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span>,</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112261</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112282</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;objectiveManagement&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;目标任务管理&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;目标任务管理&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112261</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">2103112281</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="literal">null</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112262</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112283</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;departmentYearlyTask&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;部门年度任务&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;部门年度任务&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112262</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">2103112282</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112263</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112284</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;personalYearlyTask&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;个人年度任务&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;个人年度任务&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112263</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">2103112282</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112264</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112285</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;quarterSelfEvaluation&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;季度自评&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;季度自评&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112264</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">2103112281</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112265</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112286</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;leaderAssigned&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;领导交办&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;领导交办&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112265</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">2103112281</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112266</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112287</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;lawSuperviseAlarm&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;执法督办预警&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="string">&quot;执法督办预警&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112266</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;http://172.19.196.194:8080/XZZF/MAPI/dbjq/toDbjq.action?token=opncvcsrweiounllkoio&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112331</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112331</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;dailyRecord&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;工作日志&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112331</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">2103112281</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="string">&quot;id&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;stayOnTop&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112337</span>,</span><br><span class="line">        <span class="string">&quot;desktopFlag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="string">&quot;desktopLeft&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;desktopTop&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="string">&quot;navItem&quot;</span>: &#123;</span><br><span class="line">            <span class="string">&quot;navItemID&quot;</span>: <span class="number">2103112337</span>,</span><br><span class="line">            <span class="string">&quot;navItemName&quot;</span>: <span class="string">&quot;transportManage&quot;</span>,</span><br><span class="line">            <span class="string">&quot;displayName&quot;</span>: <span class="string">&quot;用车管理&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemDesc&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemIcon&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;navItemTitle&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;displayOrder&quot;</span>: <span class="number">2103112337</span>,</span><br><span class="line">            <span class="string">&quot;url&quot;</span>: <span class="string">&quot;http://172.19.218.32:8080/eUrbanMIS/sanitation.htm?humanCode=?token=8EC1C1DD8B47A67CEBF8FB548985C6713FF33AF2959564895A4DAA1A8DD00B2B5EFA345E74ED9C433A229CC83313DB45&quot;</span>,</span><br><span class="line">            <span class="string">&quot;view&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">            <span class="string">&quot;modalFlag&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;openPageFlag&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;seniorID&quot;</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="string">&quot;sysID&quot;</span>: <span class="number">2021012116</span>,</span><br><span class="line">            <span class="string">&quot;maxFlag&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;width&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;height&quot;</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="string">&quot;showFlag&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;iconSizeTypeID&quot;</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="string">&quot;navItemGroupID&quot;</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="string">&quot;humanID&quot;</span>: <span class="number">101490</span></span><br><span class="line">    &#125;</span><br><span class="line">]</span><br></pre></td></tr></table></figure>

<p>这里根据surban-manage-vue/upervise项目实际页面和实际的路由代码为目标进行构成，主要合成的js代码如下</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">transPath</span>(<span class="params">permissions, humanNavBarItems</span>) </span>&#123;</span><br><span class="line">    permissionsVal = permissions.map(<span class="function">(<span class="params">item</span>) =&gt;</span> item.value.split(<span class="string">&quot;:&quot;</span>)[<span class="number">1</span>]);</span><br><span class="line">    <span class="built_in">console</span>.log(<span class="string">&quot;permissionsVal: &quot;</span>, permissionsVal);</span><br><span class="line">    humanNavBarItems = humanNavBarItems.data.humanNavBarItems;</span><br><span class="line">    <span class="keyword">let</span> navItems = humanNavBarItems.map(<span class="function">(<span class="params">item</span>) =&gt;</span> item.navItem);</span><br><span class="line">    <span class="built_in">console</span>.log(<span class="string">&quot;navItems: &quot;</span>, navItems);</span><br><span class="line">    <span class="comment">// 顶级nav，不出现在左侧导航栏中</span></span><br><span class="line">    <span class="keyword">let</span> topNavs = navItems.filter(<span class="function">(<span class="params">item</span>) =&gt;</span> !item.seniorID);</span><br><span class="line">    <span class="built_in">console</span>.log(<span class="string">&quot;topNavs: &quot;</span>, topNavs);</span><br><span class="line">    topNavs.forEach(<span class="function">(<span class="params">element</span>) =&gt;</span> &#123;</span><br><span class="line">        route.addRoute(generateRoute1(element));</span><br><span class="line">    &#125;);</span><br><span class="line">    navitems = navItems.filter(<span class="function">(<span class="params">item</span>) =&gt;</span> item.seniorID);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 筛选第二层navitem</span></span><br><span class="line">    <span class="keyword">let</span> navitems2 = navItems.filter(<span class="function">(<span class="params">item</span>) =&gt;</span> &#123;</span><br><span class="line">        <span class="keyword">let</span> seniorID = item.seniorID;</span><br><span class="line">        <span class="keyword">let</span> judge = topNavs.find(<span class="function">(<span class="params">topNav</span>) =&gt;</span> topNav.navItemID === seniorID);</span><br><span class="line">        <span class="keyword">return</span> judge;</span><br><span class="line">    &#125;);</span><br><span class="line">    <span class="built_in">console</span>.log(<span class="string">&#x27;navitems2: &#x27;</span>, navitems2);</span><br><span class="line">    navitems2.forEach(<span class="function">(<span class="params">element</span>) =&gt;</span> &#123;</span><br><span class="line">        route.addRoute(getParentName(topNavs, element), generateRoute2(element));</span><br><span class="line">    &#125;);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 筛选第三层navitem</span></span><br><span class="line">    <span class="keyword">let</span> navitems3 = navItems.filter(<span class="function">(<span class="params">item</span>) =&gt;</span> &#123;</span><br><span class="line">        <span class="keyword">let</span> seniorID = item.seniorID;</span><br><span class="line">        <span class="keyword">let</span> judge = navitems2.find(<span class="function">(<span class="params">navitems</span>) =&gt;</span> navitems.navItemID === seniorID);</span><br><span class="line">        <span class="keyword">return</span> judge;</span><br><span class="line">    &#125;);</span><br><span class="line">    <span class="built_in">console</span>.log(<span class="string">&#x27;navitems3: &#x27;</span>, navitems3);</span><br><span class="line">    navitems3.forEach(<span class="function">(<span class="params">element</span>) =&gt;</span> &#123;</span><br><span class="line">        route.addRoute(getParentName(navitems2, element), generateRoute2(element));</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getParentName</span>(<span class="params">parents, nav</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> parents.find(<span class="function">(<span class="params">item</span>) =&gt;</span> item.navItemID === nav.seniorID).navItemName;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">generateRoute1</span>(<span class="params">nav</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> &#123;</span><br><span class="line">        <span class="attr">name</span>: nav.navItemName,</span><br><span class="line">        <span class="attr">path</span>: nav.navItemName,</span><br><span class="line">        <span class="attr">meta</span>: &#123;</span><br><span class="line">            <span class="attr">icon</span>: nav.navItemIcon,</span><br><span class="line">            <span class="attr">title</span>: nav.navItemTitle,</span><br><span class="line">            <span class="attr">schemaId</span>: <span class="string">&quot;superviseInspect:&quot;</span> + nav.navItemName</span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="attr">component</span>: <span class="function">() =&gt;</span> <span class="function">() =&gt;</span> <span class="keyword">import</span>(<span class="string">&quot;@/components/layout/main&quot;</span>)</span><br><span class="line">    &#125;;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">generateRoute2</span>(<span class="params">nav</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> &#123;</span><br><span class="line">        <span class="attr">name</span>: nav.navItemName,</span><br><span class="line">        <span class="attr">path</span>: nav.navItemName,</span><br><span class="line">        <span class="attr">meta</span>: &#123;</span><br><span class="line">            <span class="attr">icon</span>: nav.navItemIcon,</span><br><span class="line">            <span class="attr">title</span>: nav.navItemTitle,</span><br><span class="line">            <span class="attr">schemaId</span>: <span class="string">&quot;superviseInspect:&quot;</span> + nav.navItemName</span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="attr">component</span>: <span class="function">() =&gt;</span> <span class="keyword">import</span>(<span class="string">&quot;@/components/layout/blank/index&quot;</span>)</span><br><span class="line">    &#125;;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">generateRoute3</span>(<span class="params">nav</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> &#123;</span><br><span class="line">        <span class="attr">name</span>: nav.navItemName,</span><br><span class="line">        <span class="attr">path</span>: nav.navItemName,</span><br><span class="line">        <span class="attr">meta</span>: &#123;</span><br><span class="line">            <span class="attr">icon</span>: nav.navItemIcon,</span><br><span class="line">            <span class="attr">title</span>: nav.navItemTitle,</span><br><span class="line">            <span class="attr">schemaId</span>: <span class="string">&quot;superviseInspect:&quot;</span> + nav.navItemName</span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="comment">// 这里就需要特殊处理找到自己对应项目的灵珑页面组件了</span></span><br><span class="line">        <span class="attr">component</span>: linglongTest</span><br><span class="line">    &#125;;</span><br><span class="line">&#125;</span><br><span class="line">transPath(permissions, humanNavBarItems);</span><br></pre></td></tr></table></figure>

<p>大概就这么个思路，其中里面的一些如<strong>redirect</strong>,<strong>component的引入</strong>等都是一个问题，需要根据实际项目进行解决，一个思路为通过项目配置文件配置component的基本引入路径，然后进行实际的引入</p>
</div></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">晟松</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://chengsong.info/2022/07/16/项目引入灵珑优化/">https://chengsong.info/2022/07/16/项目引入灵珑优化/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://chengsong.info">晟松</a>！</span></div></div><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/vue/">vue</a></div><nav id="pagination"><div class="prev-post pull-left"><a href="/2022/07/23/git%E4%B8%8D%E5%B8%B8%E8%A7%81%E6%93%8D%E4%BD%9C%E7%86%9F%E6%82%89/"><i class="fa fa-chevron-left">  </i><span>git不常见操作熟悉</span></a></div><div class="next-post pull-right"><a href="/2022/03/03/vite%E5%88%9D%E5%AD%A6%E4%B9%A0/"><span>vite初学习</span><i class="fa fa-chevron-right"></i></a></div></nav></div></div><footer class="footer-bg" style="background-image: url(/img/blog-bg.jpg)"><div class="layout" id="footer"><div class="copyright">&copy;2020 - 2023 By 晟松</div><div class="framework-info"><span>驱动 - </span><a target="_blank" rel="noopener" href="http://hexo.io"><span>Hexo</span></a><span class="footer-separator">|</span><span>主题 - </span><a target="_blank" rel="noopener" href="https://github.com/Molunerfinn/hexo-theme-melody"><span>Melody</span></a></div><div class="icp"><a target="_blank" rel="noopener" href="http://www.beian.miit.gov.cn/"><span>湘ICP备2020021729号</span></a></div><div class="busuanzi"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span id="busuanzi_container_page_pv"><i class="fa fa-file"></i><span id="busuanzi_value_page_pv"></span><span></span></span></div></div></footer><i class="fa fa-arrow-up" id="go-up" aria-hidden="true"></i><script src="https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js"></script><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@latest/velocity.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-ui-pack@latest/velocity.ui.min.js"></script><script src="/js/utils.js?version=1.9.0"></script><script src="/js/fancybox.js?version=1.9.0"></script><script src="/js/sidebar.js?version=1.9.0"></script><script src="/js/copy.js?version=1.9.0"></script><script src="/js/fireworks.js?version=1.9.0"></script><script src="/js/transition.js?version=1.9.0"></script><script src="/js/scroll.js?version=1.9.0"></script><script src="/js/head.js?version=1.9.0"></script><script src="/js/search/local-search.js"></script><script>if(/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
  $('#nav').addClass('is-mobile')
  $('footer').addClass('is-mobile')
  $('#top-container').addClass('is-mobile')
}</script><div class="search-dialog" id="local-search"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章"></div></div></div><hr><div id="local-search-results"><div id="local-hits"></div><div id="local-stats"><div class="local-search-stats__hr" id="hr"><span>由</span> <a target="_blank" rel="noopener" href="https://github.com/wzpan/hexo-generator-search" style="color:#49B1F5;">hexo-generator-search</a>
 <span>提供支持</span></div></div></div><span class="search-close-button"><i class="fa fa-times"></i></span></div><div class="search-mask"></div></body></html>